package calao.util;

/** A cursor used to iterate over a sequence of values.
 * Cursor provides a method to close the iteration and release associated resources.
 */
public interface Cursor<V> {
	
	/** Moves forward to the next value.
	 * 
	 * @return True if there is at least one more item available, false otherwise.
	 */
	public boolean next();
	
	/** Gets the current item in the sequence.
	 */
	public V get();
	
	/** Sets the current item in the sequence.
	 */
	public void set(V value);

	/** Deletes the item at the current position.
	 */
	public void delete();
	
	/** Closes this cursor.
	 */
	public void close();
	
	/** Skips a number of values.
	 * 
	 * @param count the number of values to skip.
	 * @return The number of values skipped.
	 */
	public long skipNext(long count);
		
}
